<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableEscrow class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableEscrow object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableEscrowMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableEscrow $TableEscrow the actual TableEscrow data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdFromControl
	 * property-read QLabel $UserIdFromLabel
	 * property QListBox $UserIdToControl
	 * property-read QLabel $UserIdToLabel
	 * property QListBox $ProjectIdControl
	 * property-read QLabel $ProjectIdLabel
	 * property QIntegerTextBox $AmountControl
	 * property-read QLabel $AmountLabel
	 * property QTextBox $ReasonControl
	 * property-read QLabel $ReasonLabel
	 * property QDateTimePicker $EscrowDateControl
	 * property-read QLabel $EscrowDateLabel
	 * property QDateTimePicker $CancelDateControl
	 * property-read QLabel $CancelDateLabel
	 * property QDateTimePicker $PaidDateControl
	 * property-read QLabel $PaidDateLabel
	 * property QIntegerTextBox $FeeForUserFromControl
	 * property-read QLabel $FeeForUserFromLabel
	 * property QIntegerTextBox $FeeForUserToControl
	 * property-read QLabel $FeeForUserToLabel
	 * property QIntegerTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property QTextBox $SignForReleaseControl
	 * property-read QLabel $SignForReleaseLabel
	 * property QIntegerTextBox $TransactionIdControl
	 * property-read QLabel $TransactionIdLabel
	 * property QIntegerTextBox $TypeControl
	 * property-read QLabel $TypeLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableEscrowMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableEscrow;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableEscrow's individual data fields
		protected $lblId;
		protected $lstUserIdFromObject;
		protected $lstUserIdToObject;
		protected $lstProject;
		protected $txtAmount;
		protected $txtReason;
		protected $calEscrowDate;
		protected $calCancelDate;
		protected $calPaidDate;
		protected $txtFeeForUserFrom;
		protected $txtFeeForUserTo;
		protected $txtStatus;
		protected $txtSignForRelease;
		protected $txtTransactionId;
		protected $txtType;

		// Controls that allow the viewing of TableEscrow's individual data fields
		protected $lblUserIdFrom;
		protected $lblUserIdTo;
		protected $lblProjectId;
		protected $lblAmount;
		protected $lblReason;
		protected $lblEscrowDate;
		protected $lblCancelDate;
		protected $lblPaidDate;
		protected $lblFeeForUserFrom;
		protected $lblFeeForUserTo;
		protected $lblStatus;
		protected $lblSignForRelease;
		protected $lblTransactionId;
		protected $lblType;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableEscrowMetaControl to edit a single TableEscrow object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableEscrow object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEscrowMetaControl
		 * @param TableEscrow $objTableEscrow new or existing TableEscrow object
		 */
		 public function __construct($objParentObject, TableEscrow $objTableEscrow) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableEscrowMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableEscrow object
			$this->objTableEscrow = $objTableEscrow;

			// Figure out if we're Editing or Creating New
			if ($this->objTableEscrow->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEscrowMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableEscrow object creation - defaults to CreateOrEdit
 		 * @return TableEscrowMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableEscrow = TableEscrow::Load($intId);

				// TableEscrow was found -- return it!
				if ($objTableEscrow)
					return new TableEscrowMetaControl($objParentObject, $objTableEscrow);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableEscrow object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableEscrowMetaControl($objParentObject, new TableEscrow());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEscrowMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableEscrow object creation - defaults to CreateOrEdit
		 * @return TableEscrowMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableEscrowMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableEscrowMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableEscrow object creation - defaults to CreateOrEdit
		 * @return TableEscrowMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableEscrowMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableEscrow->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUserIdFromObject
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUserIdFromObject_Create($strControlId = null) {
			$this->lstUserIdFromObject = new QListBox($this->objParentObject, $strControlId);
			$this->lstUserIdFromObject->Name = QApplication::Translate('User Id From Object');
			$this->lstUserIdFromObject->Required = true;
			if (!$this->blnEditMode)
				$this->lstUserIdFromObject->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserIdFromObjectArray = TableUserProject::LoadAll();
			if ($objUserIdFromObjectArray) foreach ($objUserIdFromObjectArray as $objUserIdFromObject) {
				$objListItem = new QListItem($objUserIdFromObject->__toString(), $objUserIdFromObject->Id);
				if (($this->objTableEscrow->UserIdFromObject) && ($this->objTableEscrow->UserIdFromObject->Id == $objUserIdFromObject->Id))
					$objListItem->Selected = true;
				$this->lstUserIdFromObject->AddItem($objListItem);
			}
			return $this->lstUserIdFromObject;
		}

		/**
		 * Create and setup QLabel lblUserIdFrom
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserIdFrom_Create($strControlId = null) {
			$this->lblUserIdFrom = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserIdFrom->Name = QApplication::Translate('User Id From Object');
			$this->lblUserIdFrom->Text = ($this->objTableEscrow->UserIdFromObject) ? $this->objTableEscrow->UserIdFromObject->__toString() : null;
			$this->lblUserIdFrom->Required = true;
			return $this->lblUserIdFrom;
		}

		/**
		 * Create and setup QListBox lstUserIdToObject
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUserIdToObject_Create($strControlId = null) {
			$this->lstUserIdToObject = new QListBox($this->objParentObject, $strControlId);
			$this->lstUserIdToObject->Name = QApplication::Translate('User Id To Object');
			$this->lstUserIdToObject->Required = true;
			if (!$this->blnEditMode)
				$this->lstUserIdToObject->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserIdToObjectArray = TableUserProject::LoadAll();
			if ($objUserIdToObjectArray) foreach ($objUserIdToObjectArray as $objUserIdToObject) {
				$objListItem = new QListItem($objUserIdToObject->__toString(), $objUserIdToObject->Id);
				if (($this->objTableEscrow->UserIdToObject) && ($this->objTableEscrow->UserIdToObject->Id == $objUserIdToObject->Id))
					$objListItem->Selected = true;
				$this->lstUserIdToObject->AddItem($objListItem);
			}
			return $this->lstUserIdToObject;
		}

		/**
		 * Create and setup QLabel lblUserIdTo
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserIdTo_Create($strControlId = null) {
			$this->lblUserIdTo = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserIdTo->Name = QApplication::Translate('User Id To Object');
			$this->lblUserIdTo->Text = ($this->objTableEscrow->UserIdToObject) ? $this->objTableEscrow->UserIdToObject->__toString() : null;
			$this->lblUserIdTo->Required = true;
			return $this->lblUserIdTo;
		}

		/**
		 * Create and setup QListBox lstProject
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstProject_Create($strControlId = null) {
			$this->lstProject = new QListBox($this->objParentObject, $strControlId);
			$this->lstProject->Name = QApplication::Translate('Project');
			$this->lstProject->Required = true;
			if (!$this->blnEditMode)
				$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
			$objProjectArray = TableProject::LoadAll();
			if ($objProjectArray) foreach ($objProjectArray as $objProject) {
				$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
				if (($this->objTableEscrow->Project) && ($this->objTableEscrow->Project->Id == $objProject->Id))
					$objListItem->Selected = true;
				$this->lstProject->AddItem($objListItem);
			}
			return $this->lstProject;
		}

		/**
		 * Create and setup QLabel lblProjectId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblProjectId_Create($strControlId = null) {
			$this->lblProjectId = new QLabel($this->objParentObject, $strControlId);
			$this->lblProjectId->Name = QApplication::Translate('Project');
			$this->lblProjectId->Text = ($this->objTableEscrow->Project) ? $this->objTableEscrow->Project->__toString() : null;
			$this->lblProjectId->Required = true;
			return $this->lblProjectId;
		}

		/**
		 * Create and setup QIntegerTextBox txtAmount
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtAmount_Create($strControlId = null) {
			$this->txtAmount = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtAmount->Name = QApplication::Translate('Amount');
			$this->txtAmount->Text = $this->objTableEscrow->Amount;
			$this->txtAmount->Required = true;
			return $this->txtAmount;
		}

		/**
		 * Create and setup QLabel lblAmount
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblAmount_Create($strControlId = null, $strFormat = null) {
			$this->lblAmount = new QLabel($this->objParentObject, $strControlId);
			$this->lblAmount->Name = QApplication::Translate('Amount');
			$this->lblAmount->Text = $this->objTableEscrow->Amount;
			$this->lblAmount->Required = true;
			$this->lblAmount->Format = $strFormat;
			return $this->lblAmount;
		}

		/**
		 * Create and setup QTextBox txtReason
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtReason_Create($strControlId = null) {
			$this->txtReason = new QTextBox($this->objParentObject, $strControlId);
			$this->txtReason->Name = QApplication::Translate('Reason');
			$this->txtReason->Text = $this->objTableEscrow->Reason;
			$this->txtReason->Required = true;
			$this->txtReason->MaxLength = TableEscrow::ReasonMaxLength;
			return $this->txtReason;
		}

		/**
		 * Create and setup QLabel lblReason
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblReason_Create($strControlId = null) {
			$this->lblReason = new QLabel($this->objParentObject, $strControlId);
			$this->lblReason->Name = QApplication::Translate('Reason');
			$this->lblReason->Text = $this->objTableEscrow->Reason;
			$this->lblReason->Required = true;
			return $this->lblReason;
		}

		/**
		 * Create and setup QDateTimePicker calEscrowDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calEscrowDate_Create($strControlId = null) {
			$this->calEscrowDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calEscrowDate->Name = QApplication::Translate('Escrow Date');
			$this->calEscrowDate->DateTime = $this->objTableEscrow->EscrowDate;
			$this->calEscrowDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calEscrowDate;
		}

		/**
		 * Create and setup QLabel lblEscrowDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblEscrowDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblEscrowDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblEscrowDate->Name = QApplication::Translate('Escrow Date');
			$this->strEscrowDateDateTimeFormat = $strDateTimeFormat;
			$this->lblEscrowDate->Text = sprintf($this->objTableEscrow->EscrowDate) ? $this->objTableEscrow->EscrowDate->__toString($this->strEscrowDateDateTimeFormat) : null;
			return $this->lblEscrowDate;
		}

		protected $strEscrowDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calCancelDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calCancelDate_Create($strControlId = null) {
			$this->calCancelDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calCancelDate->Name = QApplication::Translate('Cancel Date');
			$this->calCancelDate->DateTime = $this->objTableEscrow->CancelDate;
			$this->calCancelDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calCancelDate;
		}

		/**
		 * Create and setup QLabel lblCancelDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblCancelDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblCancelDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblCancelDate->Name = QApplication::Translate('Cancel Date');
			$this->strCancelDateDateTimeFormat = $strDateTimeFormat;
			$this->lblCancelDate->Text = sprintf($this->objTableEscrow->CancelDate) ? $this->objTableEscrow->CancelDate->__toString($this->strCancelDateDateTimeFormat) : null;
			return $this->lblCancelDate;
		}

		protected $strCancelDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calPaidDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calPaidDate_Create($strControlId = null) {
			$this->calPaidDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calPaidDate->Name = QApplication::Translate('Paid Date');
			$this->calPaidDate->DateTime = $this->objTableEscrow->PaidDate;
			$this->calPaidDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calPaidDate;
		}

		/**
		 * Create and setup QLabel lblPaidDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblPaidDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblPaidDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblPaidDate->Name = QApplication::Translate('Paid Date');
			$this->strPaidDateDateTimeFormat = $strDateTimeFormat;
			$this->lblPaidDate->Text = sprintf($this->objTableEscrow->PaidDate) ? $this->objTableEscrow->PaidDate->__toString($this->strPaidDateDateTimeFormat) : null;
			return $this->lblPaidDate;
		}

		protected $strPaidDateDateTimeFormat;


		/**
		 * Create and setup QIntegerTextBox txtFeeForUserFrom
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtFeeForUserFrom_Create($strControlId = null) {
			$this->txtFeeForUserFrom = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtFeeForUserFrom->Name = QApplication::Translate('Fee For User From');
			$this->txtFeeForUserFrom->Text = $this->objTableEscrow->FeeForUserFrom;
			$this->txtFeeForUserFrom->Required = true;
			return $this->txtFeeForUserFrom;
		}

		/**
		 * Create and setup QLabel lblFeeForUserFrom
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblFeeForUserFrom_Create($strControlId = null, $strFormat = null) {
			$this->lblFeeForUserFrom = new QLabel($this->objParentObject, $strControlId);
			$this->lblFeeForUserFrom->Name = QApplication::Translate('Fee For User From');
			$this->lblFeeForUserFrom->Text = $this->objTableEscrow->FeeForUserFrom;
			$this->lblFeeForUserFrom->Required = true;
			$this->lblFeeForUserFrom->Format = $strFormat;
			return $this->lblFeeForUserFrom;
		}

		/**
		 * Create and setup QIntegerTextBox txtFeeForUserTo
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtFeeForUserTo_Create($strControlId = null) {
			$this->txtFeeForUserTo = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtFeeForUserTo->Name = QApplication::Translate('Fee For User To');
			$this->txtFeeForUserTo->Text = $this->objTableEscrow->FeeForUserTo;
			$this->txtFeeForUserTo->Required = true;
			return $this->txtFeeForUserTo;
		}

		/**
		 * Create and setup QLabel lblFeeForUserTo
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblFeeForUserTo_Create($strControlId = null, $strFormat = null) {
			$this->lblFeeForUserTo = new QLabel($this->objParentObject, $strControlId);
			$this->lblFeeForUserTo->Name = QApplication::Translate('Fee For User To');
			$this->lblFeeForUserTo->Text = $this->objTableEscrow->FeeForUserTo;
			$this->lblFeeForUserTo->Required = true;
			$this->lblFeeForUserTo->Format = $strFormat;
			return $this->lblFeeForUserTo;
		}

		/**
		 * Create and setup QIntegerTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objTableEscrow->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objTableEscrow->Status;
			$this->lblStatus->Required = true;
			$this->lblStatus->Format = $strFormat;
			return $this->lblStatus;
		}

		/**
		 * Create and setup QTextBox txtSignForRelease
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSignForRelease_Create($strControlId = null) {
			$this->txtSignForRelease = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSignForRelease->Name = QApplication::Translate('Sign For Release');
			$this->txtSignForRelease->Text = $this->objTableEscrow->SignForRelease;
			$this->txtSignForRelease->MaxLength = TableEscrow::SignForReleaseMaxLength;
			return $this->txtSignForRelease;
		}

		/**
		 * Create and setup QLabel lblSignForRelease
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSignForRelease_Create($strControlId = null) {
			$this->lblSignForRelease = new QLabel($this->objParentObject, $strControlId);
			$this->lblSignForRelease->Name = QApplication::Translate('Sign For Release');
			$this->lblSignForRelease->Text = $this->objTableEscrow->SignForRelease;
			return $this->lblSignForRelease;
		}

		/**
		 * Create and setup QIntegerTextBox txtTransactionId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtTransactionId_Create($strControlId = null) {
			$this->txtTransactionId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtTransactionId->Name = QApplication::Translate('Transaction Id');
			$this->txtTransactionId->Text = $this->objTableEscrow->TransactionId;
			$this->txtTransactionId->Required = true;
			return $this->txtTransactionId;
		}

		/**
		 * Create and setup QLabel lblTransactionId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblTransactionId_Create($strControlId = null, $strFormat = null) {
			$this->lblTransactionId = new QLabel($this->objParentObject, $strControlId);
			$this->lblTransactionId->Name = QApplication::Translate('Transaction Id');
			$this->lblTransactionId->Text = $this->objTableEscrow->TransactionId;
			$this->lblTransactionId->Required = true;
			$this->lblTransactionId->Format = $strFormat;
			return $this->lblTransactionId;
		}

		/**
		 * Create and setup QIntegerTextBox txtType
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtType_Create($strControlId = null) {
			$this->txtType = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtType->Name = QApplication::Translate('Type');
			$this->txtType->Text = $this->objTableEscrow->Type;
			$this->txtType->Required = true;
			return $this->txtType;
		}

		/**
		 * Create and setup QLabel lblType
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblType_Create($strControlId = null, $strFormat = null) {
			$this->lblType = new QLabel($this->objParentObject, $strControlId);
			$this->lblType->Name = QApplication::Translate('Type');
			$this->lblType->Text = $this->objTableEscrow->Type;
			$this->lblType->Required = true;
			$this->lblType->Format = $strFormat;
			return $this->lblType;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableEscrow object.
		 * @param boolean $blnReload reload TableEscrow from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableEscrow->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableEscrow->Id;

			if ($this->lstUserIdFromObject) {
					$this->lstUserIdFromObject->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUserIdFromObject->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserIdFromObjectArray = TableUserProject::LoadAll();
				if ($objUserIdFromObjectArray) foreach ($objUserIdFromObjectArray as $objUserIdFromObject) {
					$objListItem = new QListItem($objUserIdFromObject->__toString(), $objUserIdFromObject->Id);
					if (($this->objTableEscrow->UserIdFromObject) && ($this->objTableEscrow->UserIdFromObject->Id == $objUserIdFromObject->Id))
						$objListItem->Selected = true;
					$this->lstUserIdFromObject->AddItem($objListItem);
				}
			}
			if ($this->lblUserIdFrom) $this->lblUserIdFrom->Text = ($this->objTableEscrow->UserIdFromObject) ? $this->objTableEscrow->UserIdFromObject->__toString() : null;

			if ($this->lstUserIdToObject) {
					$this->lstUserIdToObject->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUserIdToObject->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserIdToObjectArray = TableUserProject::LoadAll();
				if ($objUserIdToObjectArray) foreach ($objUserIdToObjectArray as $objUserIdToObject) {
					$objListItem = new QListItem($objUserIdToObject->__toString(), $objUserIdToObject->Id);
					if (($this->objTableEscrow->UserIdToObject) && ($this->objTableEscrow->UserIdToObject->Id == $objUserIdToObject->Id))
						$objListItem->Selected = true;
					$this->lstUserIdToObject->AddItem($objListItem);
				}
			}
			if ($this->lblUserIdTo) $this->lblUserIdTo->Text = ($this->objTableEscrow->UserIdToObject) ? $this->objTableEscrow->UserIdToObject->__toString() : null;

			if ($this->lstProject) {
					$this->lstProject->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
				$objProjectArray = TableProject::LoadAll();
				if ($objProjectArray) foreach ($objProjectArray as $objProject) {
					$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
					if (($this->objTableEscrow->Project) && ($this->objTableEscrow->Project->Id == $objProject->Id))
						$objListItem->Selected = true;
					$this->lstProject->AddItem($objListItem);
				}
			}
			if ($this->lblProjectId) $this->lblProjectId->Text = ($this->objTableEscrow->Project) ? $this->objTableEscrow->Project->__toString() : null;

			if ($this->txtAmount) $this->txtAmount->Text = $this->objTableEscrow->Amount;
			if ($this->lblAmount) $this->lblAmount->Text = $this->objTableEscrow->Amount;

			if ($this->txtReason) $this->txtReason->Text = $this->objTableEscrow->Reason;
			if ($this->lblReason) $this->lblReason->Text = $this->objTableEscrow->Reason;

			if ($this->calEscrowDate) $this->calEscrowDate->DateTime = $this->objTableEscrow->EscrowDate;
			if ($this->lblEscrowDate) $this->lblEscrowDate->Text = sprintf($this->objTableEscrow->EscrowDate) ? $this->objTableEscrow->EscrowDate->__toString($this->strEscrowDateDateTimeFormat) : null;

			if ($this->calCancelDate) $this->calCancelDate->DateTime = $this->objTableEscrow->CancelDate;
			if ($this->lblCancelDate) $this->lblCancelDate->Text = sprintf($this->objTableEscrow->CancelDate) ? $this->objTableEscrow->CancelDate->__toString($this->strCancelDateDateTimeFormat) : null;

			if ($this->calPaidDate) $this->calPaidDate->DateTime = $this->objTableEscrow->PaidDate;
			if ($this->lblPaidDate) $this->lblPaidDate->Text = sprintf($this->objTableEscrow->PaidDate) ? $this->objTableEscrow->PaidDate->__toString($this->strPaidDateDateTimeFormat) : null;

			if ($this->txtFeeForUserFrom) $this->txtFeeForUserFrom->Text = $this->objTableEscrow->FeeForUserFrom;
			if ($this->lblFeeForUserFrom) $this->lblFeeForUserFrom->Text = $this->objTableEscrow->FeeForUserFrom;

			if ($this->txtFeeForUserTo) $this->txtFeeForUserTo->Text = $this->objTableEscrow->FeeForUserTo;
			if ($this->lblFeeForUserTo) $this->lblFeeForUserTo->Text = $this->objTableEscrow->FeeForUserTo;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objTableEscrow->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objTableEscrow->Status;

			if ($this->txtSignForRelease) $this->txtSignForRelease->Text = $this->objTableEscrow->SignForRelease;
			if ($this->lblSignForRelease) $this->lblSignForRelease->Text = $this->objTableEscrow->SignForRelease;

			if ($this->txtTransactionId) $this->txtTransactionId->Text = $this->objTableEscrow->TransactionId;
			if ($this->lblTransactionId) $this->lblTransactionId->Text = $this->objTableEscrow->TransactionId;

			if ($this->txtType) $this->txtType->Text = $this->objTableEscrow->Type;
			if ($this->lblType) $this->lblType->Text = $this->objTableEscrow->Type;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEESCROW OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableEscrow instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableEscrow() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUserIdFromObject) $this->objTableEscrow->UserIdFrom = $this->lstUserIdFromObject->SelectedValue;
				if ($this->lstUserIdToObject) $this->objTableEscrow->UserIdTo = $this->lstUserIdToObject->SelectedValue;
				if ($this->lstProject) $this->objTableEscrow->ProjectId = $this->lstProject->SelectedValue;
				if ($this->txtAmount) $this->objTableEscrow->Amount = $this->txtAmount->Text;
				if ($this->txtReason) $this->objTableEscrow->Reason = $this->txtReason->Text;
				if ($this->calEscrowDate) $this->objTableEscrow->EscrowDate = $this->calEscrowDate->DateTime;
				if ($this->calCancelDate) $this->objTableEscrow->CancelDate = $this->calCancelDate->DateTime;
				if ($this->calPaidDate) $this->objTableEscrow->PaidDate = $this->calPaidDate->DateTime;
				if ($this->txtFeeForUserFrom) $this->objTableEscrow->FeeForUserFrom = $this->txtFeeForUserFrom->Text;
				if ($this->txtFeeForUserTo) $this->objTableEscrow->FeeForUserTo = $this->txtFeeForUserTo->Text;
				if ($this->txtStatus) $this->objTableEscrow->Status = $this->txtStatus->Text;
				if ($this->txtSignForRelease) $this->objTableEscrow->SignForRelease = $this->txtSignForRelease->Text;
				if ($this->txtTransactionId) $this->objTableEscrow->TransactionId = $this->txtTransactionId->Text;
				if ($this->txtType) $this->objTableEscrow->Type = $this->txtType->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableEscrow object
				$this->objTableEscrow->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableEscrow instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableEscrow() {
			$this->objTableEscrow->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableEscrow': return $this->objTableEscrow;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableEscrow fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdFromControl':
					if (!$this->lstUserIdFromObject) return $this->lstUserIdFromObject_Create();
					return $this->lstUserIdFromObject;
				case 'UserIdFromLabel':
					if (!$this->lblUserIdFrom) return $this->lblUserIdFrom_Create();
					return $this->lblUserIdFrom;
				case 'UserIdToControl':
					if (!$this->lstUserIdToObject) return $this->lstUserIdToObject_Create();
					return $this->lstUserIdToObject;
				case 'UserIdToLabel':
					if (!$this->lblUserIdTo) return $this->lblUserIdTo_Create();
					return $this->lblUserIdTo;
				case 'ProjectIdControl':
					if (!$this->lstProject) return $this->lstProject_Create();
					return $this->lstProject;
				case 'ProjectIdLabel':
					if (!$this->lblProjectId) return $this->lblProjectId_Create();
					return $this->lblProjectId;
				case 'AmountControl':
					if (!$this->txtAmount) return $this->txtAmount_Create();
					return $this->txtAmount;
				case 'AmountLabel':
					if (!$this->lblAmount) return $this->lblAmount_Create();
					return $this->lblAmount;
				case 'ReasonControl':
					if (!$this->txtReason) return $this->txtReason_Create();
					return $this->txtReason;
				case 'ReasonLabel':
					if (!$this->lblReason) return $this->lblReason_Create();
					return $this->lblReason;
				case 'EscrowDateControl':
					if (!$this->calEscrowDate) return $this->calEscrowDate_Create();
					return $this->calEscrowDate;
				case 'EscrowDateLabel':
					if (!$this->lblEscrowDate) return $this->lblEscrowDate_Create();
					return $this->lblEscrowDate;
				case 'CancelDateControl':
					if (!$this->calCancelDate) return $this->calCancelDate_Create();
					return $this->calCancelDate;
				case 'CancelDateLabel':
					if (!$this->lblCancelDate) return $this->lblCancelDate_Create();
					return $this->lblCancelDate;
				case 'PaidDateControl':
					if (!$this->calPaidDate) return $this->calPaidDate_Create();
					return $this->calPaidDate;
				case 'PaidDateLabel':
					if (!$this->lblPaidDate) return $this->lblPaidDate_Create();
					return $this->lblPaidDate;
				case 'FeeForUserFromControl':
					if (!$this->txtFeeForUserFrom) return $this->txtFeeForUserFrom_Create();
					return $this->txtFeeForUserFrom;
				case 'FeeForUserFromLabel':
					if (!$this->lblFeeForUserFrom) return $this->lblFeeForUserFrom_Create();
					return $this->lblFeeForUserFrom;
				case 'FeeForUserToControl':
					if (!$this->txtFeeForUserTo) return $this->txtFeeForUserTo_Create();
					return $this->txtFeeForUserTo;
				case 'FeeForUserToLabel':
					if (!$this->lblFeeForUserTo) return $this->lblFeeForUserTo_Create();
					return $this->lblFeeForUserTo;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				case 'SignForReleaseControl':
					if (!$this->txtSignForRelease) return $this->txtSignForRelease_Create();
					return $this->txtSignForRelease;
				case 'SignForReleaseLabel':
					if (!$this->lblSignForRelease) return $this->lblSignForRelease_Create();
					return $this->lblSignForRelease;
				case 'TransactionIdControl':
					if (!$this->txtTransactionId) return $this->txtTransactionId_Create();
					return $this->txtTransactionId;
				case 'TransactionIdLabel':
					if (!$this->lblTransactionId) return $this->lblTransactionId_Create();
					return $this->lblTransactionId;
				case 'TypeControl':
					if (!$this->txtType) return $this->txtType_Create();
					return $this->txtType;
				case 'TypeLabel':
					if (!$this->lblType) return $this->lblType_Create();
					return $this->lblType;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableEscrow fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdFromControl':
						return ($this->lstUserIdFromObject = QType::Cast($mixValue, 'QControl'));
					case 'UserIdToControl':
						return ($this->lstUserIdToObject = QType::Cast($mixValue, 'QControl'));
					case 'ProjectIdControl':
						return ($this->lstProject = QType::Cast($mixValue, 'QControl'));
					case 'AmountControl':
						return ($this->txtAmount = QType::Cast($mixValue, 'QControl'));
					case 'ReasonControl':
						return ($this->txtReason = QType::Cast($mixValue, 'QControl'));
					case 'EscrowDateControl':
						return ($this->calEscrowDate = QType::Cast($mixValue, 'QControl'));
					case 'CancelDateControl':
						return ($this->calCancelDate = QType::Cast($mixValue, 'QControl'));
					case 'PaidDateControl':
						return ($this->calPaidDate = QType::Cast($mixValue, 'QControl'));
					case 'FeeForUserFromControl':
						return ($this->txtFeeForUserFrom = QType::Cast($mixValue, 'QControl'));
					case 'FeeForUserToControl':
						return ($this->txtFeeForUserTo = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					case 'SignForReleaseControl':
						return ($this->txtSignForRelease = QType::Cast($mixValue, 'QControl'));
					case 'TransactionIdControl':
						return ($this->txtTransactionId = QType::Cast($mixValue, 'QControl'));
					case 'TypeControl':
						return ($this->txtType = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>